package com.lifeng.springevent.defaultevent;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextClosedEvent;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.ContextStartedEvent;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * Created by lifeng on 2019/8/5.
 *  * ContextStartedEvent 监听Spring容器启动时事件,当容器调用start()方法时触发
 *  ApplicationContext启动后触发的事件；（目前版本没有任何作用）
 */
@Component
public class MySpringStartedListener implements ApplicationListener<ContextStartedEvent>{
    private static final Logger log = LoggerFactory.getLogger(MySpringStartedListener.class);

	@Override
	public void onApplicationEvent(ContextStartedEvent event) {
		System.out.println("started...");
	}

}
